<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 利用函数任意数组 reverse 翻转
        function reverse(arr) { // arr = [1,2,3,4]
            var newArr = [];
            for (var i = arr.length; i >= 0; i--) { //旧的数组arr 遍历数组 那么i 一共就是4 
                newArr[newArr.length] = arr[i]; // newArr[0] = arr[4] 没有 4。  newArr[]
            }
            return newArr;
        }
        var arr1 = reverse([1, 2, 3, 4])
        console.log(arr1);
    </script>
</head>

<body>

</body>

</html>